package com.orphan.audit.dao;

import com.orphan.audit.po.SupplierCheck;
import com.orphan.audit.po.SupplierReturnAudit;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.orphan.util.dto.SupplierReturnDto;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.FetchType;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yichen
 * @since 2021-07-14
 */
@Mapper
public interface SupplierReturnAuditMapper extends BaseMapper<SupplierReturnAudit> {
    @Select("select * from t_supplierreturn_audit")
    List<SupplierReturnAudit> findAll();

//    @Select("select t_supplierreturn_audit.t_id,t_supplierreturn_audit.t_orderId,t_supplierreturn_audit.t_goodsNum,t_supplierreturn_audit.t_orderTime,t_supplierreturn_audit.t_total,t_supplierreturn_audit.t_state,\n" +
//            "               t_supplierreturn_commodity.goods_id,t_supplierreturn_commodity.goods_name,t_supplierreturn_commodity.t_size,t_supplierreturn_commodity.goods_price from t_supplierreturn_audit,t_supplierreturn_commodity WHERE t_supplierreturn_audit.t_id = t_supplierreturn_commodity.fk_id")
//    List<SupplierReturnDto> getAll();


    @Results(id = "supplierReturnMap",value = {
            @Result(column = "t_id",property = "tId",id = true),
            @Result(column = "order_id",property = "orderId"),
            @Result(column = "t_supplierName",property = "tSupplierName"),
            @Result(column = "t_orderTime",property = "tOrdertime"),
            @Result(column = "t_total",property = "tTotal"),
            @Result(column = "t_state",property = "tState"),

    })
    @Select("select * from t_supplierreturn_audit where t_id=#{tId}")
    SupplierReturnAudit getById(@Param("tId")Integer tId);

}
